package com.niiwoo.civet.trade.dto.request.loan;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Date;

/**
 * 推标接口参数
 * @author xueyuke
 * @date 2017-12-22
 */
@Setter
@Getter
public class PushProjectRequestDTO implements Serializable {
    private static final long serialVersionUID = 5953693066639255551L;

    /**
     * 项目ID
     */
    private Long projectId;

    /**
     * 审核时间
     */
    private Date auditedTime;

    /**
     * 审核人员用户ID
     */
    private Long auditManagerId;

    /**
     * 审核人员姓名
     */
    private String auditManagerName;

    /**
     * 推送来源
     */
    private PushFromEnum pushFromEnum;

    /**
     * 推送记录表ID
     */
    private Long projectPushRecordId;

    /**
     * 推送来源枚举
     */
    @Getter
    @AllArgsConstructor
    public enum PushFromEnum{
        AUTO_AUDIT((byte)1,"自动审核"),
        HAND_AUDIT((byte)2,"人工审核");

        private Byte type;
        private String desc;

        public static PushFromEnum getEnumByType(Byte type){
            if(type==null){
                return null;
            }

            for(PushFromEnum pushFromEnum:PushFromEnum.values()){
                if(type.equals(pushFromEnum.getType())){
                    return pushFromEnum;
                }
            }

            return null;
        }
    }
}
